__kernel void ellpack_opencl(__global float * values, __global int * col_idx, __const int num_rows, __const int nonzeros_per_row, __global float * v, __global float * answer) {
  
	const int idx = get_global_id(0);
	
	if (idx >= num_rows)
		return;

	float sum = 0.0f;
	int _row = idx;
	
	for (int i = nonzeros_per_row * idx; i < (nonzeros_per_row * (idx + 1)); i++) {
		int _col = col_idx[i];
		float _val = values[i];
		sum += (_val * v[_col]);
	}	
	answer[_row] = sum;	
}
